1. Create a new project in Xcode. To do so select File -> New Project... from the menu bar.



2. Select the "BSD C Library" template by clicking Framework & Library -> BSD C Library.



3. Name and save the project.



4. Select the project's target and edit its information. To do so click the target to highlight it then select File -> Get Info to open the target's inspector.



5. Change the target's name to "obj1" — this example will be using the obj1.c file included with Pd vanilla.



6. Click the build tab then set Configuration to "All Configurations" by clicking the drop-down menu in the upper left corner of the dialog box.



7. Set several attributes of the target:







8. Exit the target's inspector, highlight the Source folder by clicking it, then make a new file by selecting File -> New File from the menu bar.



9. Make a new C file.



10. Name the new file obj1.c and uncheck Also create "obj1.h".



11. Copy the code from Pd's obj1.c file into the obj1.c file you just created. The file is located at /Applications/Pd-0.42-5.app/Contents/Resources/doc/6.externs/obj1.c.



12. Save the file, then set the project's processor architecture to i386 (assuming you have an intel mac), by selecting Project -> Set Active Architecture -> i386.



13. Build the target by selecting Build -> Build from the menu bar.



14. Open Pd and instantiate obj1, verifying its output in the Pd window.